home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Graphics Programming (2nd Edition)
/
Visual Basic Graphics Programming 2nd Edition.iso
/
OldSrc
/
CH1
/
SRC
/
BOXSIZE.FRM
< prev
next >
Wrap
Text File
|
1995-12-14
|
2KB
|
88 lines
VERSION 4.00
Begin VB.Form BoxSizeForm
Caption = "Box Size"
ClientHeight = 3450
ClientLeft = 3210
ClientTop = 1710
ClientWidth = 2760
Height = 4140
Left = 3150
LinkTopic = "Form1"
ScaleHeight = 1000
ScaleLeft = -10
ScaleMode = 0 'User
ScaleTop = 100
ScaleWidth = 10
Top = 1080
Width = 2880
Begin VB.PictureBox RightPict
AutoRedraw = -1 'True
Height = 975
Left = 120
ScaleHeight = 915
ScaleWidth = 1515
TabIndex = 1
Top = 1800
Width = 1575
End
Begin VB.PictureBox WrongPict
AutoRedraw = -1 'True
Height = 975
Left = 120
ScaleHeight = 915
ScaleWidth = 1515
TabIndex = 0
Top = 120
Width = 1575
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
End
Attribute VB_Name = "BoxSizeForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim wid As Single
Dim hgt As Single
Dim extra_wid As Single
Dim extra_hgt As Single
' Convert the desired width and height from
' twips into the form's custom coordinates.
wid = Me.ScaleX(2500, 1, 0)
hgt = Me.ScaleY(1500, 1, 0)
WrongPict.Width = wid
WrongPict.Height = hgt
WrongPict.Line (0, 750)-(1250, 0)
WrongPict.Line -(2500, 750)
WrongPict.Line -(1250, 1500)
WrongPict.Line -(0, 750)
With RightPict
extra_wid = .Width - Me.ScaleX( _
.ScaleWidth, .ScaleMode, Me.ScaleMode)
extra_hgt = .Height - Me.ScaleY( _
.ScaleHeight, .ScaleMode, Me.ScaleMode)
.Width = wid + extra_wid
.Height = hgt + extra_hgt
End With
RightPict.Line (0, 750)-(1250, 0)
RightPict.Line -(2500, 750)
RightPict.Line -(1250, 1500)
RightPict.Line -(0, 750)
End Sub
Private Sub mnuFileExit_Click()
Unload Me
End Sub